package com.dahuyou.link.monitoring;

public class TrackContext {

    private static final ThreadLocal<String> trackLocal = new ThreadLocal<String>();

    public static void clear() {
        trackLocal.remove();
    }

    public static String getTraceId() {
        String traceId = trackLocal.get();
        return traceId;
    }

    public static void setTraceId(String traceId) {
        /*
        放到treadlocal中，这样只要是在一个线程中通过get就能获取到值了
         */
        trackLocal.set(traceId);
    }
}
